#include <algorithm>
#include <cstdio>

typedef long long ll;
const int N = 50005;
int n, t, cnt1, cnt2;
ll h;

struct Node {
  int a, b;
  Node() {}
  Node(int a, int b) : a(a), b(b) {}
} add[N], sub[N];

inline void solve() {
  scanf("%d%lld", &n, &h);
  cnt1 = cnt2 = 0;
  for (int i = 1, a, b; i <= n; ++i) {
    scanf("%d%d", &a, &b);
    if (a <= b) add[++cnt1] = Node(a, b);
    else
      sub[++cnt2] = Node(a, b);
  }
  std::sort(add + 1, add + cnt1 + 1,
            [](const Node &lhs, const Node &rhs) { return lhs.a < rhs.a; });
  for (int i = 1; i <= cnt1; ++i) {
    if (h >= add[i].a) h = h - add[i].a + add[i].b;
    else
      return puts("No"), void();
  }
  std::sort(sub + 1, sub + cnt2 + 1,
            [](const Node &lhs, const Node &rhs) { return lhs.b > rhs.b; });
  for (int i = 1; i <= cnt2; ++i) {
    if (h >= sub[i].a) h = h - sub[i].a + sub[i].b;
    else
      return puts("No"), void();
  }
  return puts("Yes"), void();
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("backpack.in", "r", stdin);
  freopen("backpack.out", "w", stdout);
#endif
#endif

  scanf("%d", &t);
  while (t--) { solve(); }
  return 0;
}